{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "113ba8ed",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入城市：广州\n",
      "请输入岗位：产品经理\n",
      " * Serving Flask app '__main__' (lazy loading)\n",
      " * Environment: production\n",
      "\u001b[31m   WARNING: This is a development server. Do not use it in a production deployment.\u001b[0m\n",
      "\u001b[2m   Use a production WSGI server instead.\u001b[0m\n",
      " * Debug mode: off\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.\n",
      " * Running on http://127.0.0.1:5000\n",
      "Press CTRL+C to quit\n",
      "[2023-06-24 23:35:40,736] ERROR in app: Exception on / [GET]\n",
      "Traceback (most recent call last):\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 2073, in wsgi_app\n",
      "    response = self.full_dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1518, in full_dispatch_request\n",
      "    rv = self.handle_user_exception(e)\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1516, in full_dispatch_request\n",
      "    rv = self.dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1502, in dispatch_request\n",
      "    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)\n",
      "  File \"C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp/ipykernel_15356/908306847.py\", line 21, in index\n",
      "    liepin.liepin_data(area,keys)\n",
      "  File \"D:\\大学学习文件\\大三下\\徐志超\\fk122\\liepin.py\", line 81, in liepin_data\n",
      "    page = response_data['data']['pagination']['totalPage']\n",
      "KeyError: 'data'\n",
      "127.0.0.1 - - [24/Jun/2023 23:35:40] \"GET / HTTP/1.1\" 500 -\n",
      "127.0.0.1 - - [24/Jun/2023 23:35:40] \"GET /favicon.ico HTTP/1.1\" 404 -\n",
      "[2023-06-24 23:50:34,518] ERROR in app: Exception on / [GET]\n",
      "Traceback (most recent call last):\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 2073, in wsgi_app\n",
      "    response = self.full_dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1518, in full_dispatch_request\n",
      "    rv = self.handle_user_exception(e)\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1516, in full_dispatch_request\n",
      "    rv = self.dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1502, in dispatch_request\n",
      "    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)\n",
      "  File \"C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp/ipykernel_15356/908306847.py\", line 21, in index\n",
      "    liepin.liepin_data(area,keys)\n",
      "  File \"D:\\大学学习文件\\大三下\\徐志超\\fk122\\liepin.py\", line 81, in liepin_data\n",
      "    page = response_data['data']['pagination']['totalPage']\n",
      "KeyError: 'data'\n",
      "127.0.0.1 - - [24/Jun/2023 23:50:34] \"GET / HTTP/1.1\" 500 -\n",
      "[2023-06-24 23:52:06,544] ERROR in app: Exception on / [GET]\n",
      "Traceback (most recent call last):\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 2073, in wsgi_app\n",
      "    response = self.full_dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1518, in full_dispatch_request\n",
      "    rv = self.handle_user_exception(e)\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1516, in full_dispatch_request\n",
      "    rv = self.dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1502, in dispatch_request\n",
      "    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)\n",
      "  File \"C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp/ipykernel_15356/908306847.py\", line 21, in index\n",
      "    liepin.liepin_data(area,keys)\n",
      "  File \"D:\\大学学习文件\\大三下\\徐志超\\fk122\\liepin.py\", line 81, in liepin_data\n",
      "    page = response_data['data']['pagination']['totalPage']\n",
      "KeyError: 'data'\n",
      "127.0.0.1 - - [24/Jun/2023 23:52:06] \"GET / HTTP/1.1\" 500 -\n",
      "[2023-06-24 23:53:17,116] ERROR in app: Exception on / [GET]\n",
      "Traceback (most recent call last):\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 2073, in wsgi_app\n",
      "    response = self.full_dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1518, in full_dispatch_request\n",
      "    rv = self.handle_user_exception(e)\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1516, in full_dispatch_request\n",
      "    rv = self.dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1502, in dispatch_request\n",
      "    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)\n",
      "  File \"C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp/ipykernel_15356/908306847.py\", line 21, in index\n",
      "    liepin.liepin_data(area,keys)\n",
      "  File \"D:\\大学学习文件\\大三下\\徐志超\\fk122\\liepin.py\", line 81, in liepin_data\n",
      "    page = response_data['data']['pagination']['totalPage']\n",
      "KeyError: 'data'\n",
      "127.0.0.1 - - [24/Jun/2023 23:53:17] \"GET / HTTP/1.1\" 500 -\n",
      "[2023-06-24 23:54:20,214] ERROR in app: Exception on / [GET]\n",
      "Traceback (most recent call last):\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 2073, in wsgi_app\n",
      "    response = self.full_dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1518, in full_dispatch_request\n",
      "    rv = self.handle_user_exception(e)\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1516, in full_dispatch_request\n",
      "    rv = self.dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1502, in dispatch_request\n",
      "    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)\n",
      "  File \"C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp/ipykernel_15356/908306847.py\", line 21, in index\n",
      "    liepin.liepin_data(area,keys)\n",
      "  File \"D:\\大学学习文件\\大三下\\徐志超\\fk122\\liepin.py\", line 81, in liepin_data\n",
      "    page = response_data['data']['pagination']['totalPage']\n",
      "KeyError: 'data'\n",
      "127.0.0.1 - - [24/Jun/2023 23:54:20] \"GET / HTTP/1.1\" 500 -\n",
      "[2023-06-24 23:54:29,972] ERROR in app: Exception on / [GET]\n",
      "Traceback (most recent call last):\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 2073, in wsgi_app\n",
      "    response = self.full_dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1518, in full_dispatch_request\n",
      "    rv = self.handle_user_exception(e)\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1516, in full_dispatch_request\n",
      "    rv = self.dispatch_request()\n",
      "  File \"D:\\adobe\\lib\\site-packages\\flask\\app.py\", line 1502, in dispatch_request\n",
      "    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)\n",
      "  File \"C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp/ipykernel_15356/908306847.py\", line 21, in index\n",
      "    liepin.liepin_data(area,keys)\n",
      "  File \"D:\\大学学习文件\\大三下\\徐志超\\fk122\\liepin.py\", line 81, in liepin_data\n",
      "    page = response_data['data']['pagination']['totalPage']\n",
      "KeyError: 'data'\n",
      "127.0.0.1 - - [24/Jun/2023 23:54:29] \"GET / HTTP/1.1\" 500 -\n"
     ]
    }
   ],
   "source": [
    "import liepin\n",
    "import requests\n",
    "from flask import Flask\n",
    "from jinja2 import Markup, Environment, FileSystemLoader\n",
    "from pyecharts.globals import CurrentConfig\n",
    "\n",
    "# 关于 CurrentConfig，可参考 [基本使用-全局变量]\n",
    "CurrentConfig.GLOBAL_ENV = Environment(loader=FileSystemLoader(\"./templates\"))\n",
    "\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "\n",
    "area = input('请输入城市：')\n",
    "keys = input('请输入岗位：')\n",
    "\n",
    "\n",
    "app = Flask(__name__, static_folder=\"templates\")\n",
    "\n",
    "@app.route(\"/\")\n",
    "def index():\n",
    "    liepin.liepin_data(area,keys)\n",
    "    c = liepin.liepin_dq(area,keys)\n",
    "    return Markup(c.render_embed())\n",
    "\n",
    "\n",
    "if __name__ == \"__main__\":\n",
    "    app.run()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3be8e8ba",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.0b3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
